// 文字操作
package lwsoft

//SetDict 设置字库,成功返回1,失败返回0
func (com *LwSoft) SetDict(index int, file, pwd string) int {
	ret, _ := com.lw.CallMethod("SetDict", index, file, pwd)
	return int(ret.Val)
}

//UseDict 表示使用哪个字库文件进行识别(index范围:0-9)
func (com *LwSoft) UseDict(index int) int {
	ret, _ := com.lw.CallMethod("UseDict", index)
	return int(ret.Val)
}

//Ocr 识别屏幕范围(x1,y1,x2,y2)内符合color_format的字符串
func (com *LwSoft) Ocr(x1, y1, x2, y2 int, colorFormat string, sim float32, linesign string, isbackcolor int) string {
	ret, _ := com.lw.CallMethod("Ocr", x1, y1, x2, y2, colorFormat, sim, linesign, isbackcolor)
	return ret.ToString()
}

//FindStr 在屏幕范围(x1,y1,x2,y2)内,查找string(可以是任意个字符串的组合),
func (com *LwSoft) FindStr(x1, y1, x2, y2 int, str, colorFormat string, sim float32, isbackcolor int) int {
	ret, _ := com.lw.CallMethod("FindStr", x1, y1, x2, y2, str, colorFormat, sim, isbackcolor)
	return int(ret.Val)
}

//FindStrEx 在屏幕范围(x1,y1,x2,y2)内,查找string(可以是任意个字符串的组合)
func (com *LwSoft) FindStrEx(x1, y1, x2, y2 int, str, colorFormat string, sim float32, isbackcolor int) string {
	ret, _ := com.lw.CallMethod("FindStrEx", x1, y1, x2, y2, str, colorFormat, sim, isbackcolor)
	return ret.ToString()
}

//FindStrFast 同FindStr。
func (com *LwSoft) FindStrFast(x1, y1, x2, y2 int, str, colorFormat string, sim float32, isbackcolor int) int {
	ret, _ := com.lw.CallMethod("FindStrFast", x1, y1, x2, y2, str, colorFormat, sim, isbackcolor)
	return int(ret.Val)
}

//FindStrFastEx 同FindStrEx。
func (com *LwSoft) FindStrFastEx(x1, y1, x2, y2 int, str, colorFormat string, sim float32, isbackcolor int) string {
	ret, _ := com.lw.CallMethod("FindStrFastEx", x1, y1, x2, y2, str, colorFormat, sim, isbackcolor)
	return ret.ToString()
}
